#! /usr/bin/python
# coding: utf-8

from Tkinter import *

root = Tk()

def printItem():
    print 'Python=', vPython.get()
    print 'PHP=', vPHP.get()
    print 'CPP=', vCPP.get()
    print 'C=', vC.get()
    print 'Java=', vJava.get()
    print 'JavaScript=', vJavaScript.get()

menubar = Menu(root)

vPython = StringVar()
vPHP = StringVar()
vCPP = StringVar()
vC = StringVar()
vJava = StringVar()
vJavaScript = StringVar()

filemenu = Menu(menubar, tearoff=0)

for k, v in {'Python':vPython, 'PHP':vPHP, 'CPP':vCPP, 'C':vC, 'Java':vJava,
'JavaScript':vJavaScript}.items():
    filemenu.add_checkbutton(label=k, command=printItem, variable=v)

menubar.add_cascade(label='Language', menu=filemenu)

root['menu'] = menubar

root.mainloop()
